package com.star.platforms.controller.stock;


import com.star.platforms.common.ResultBean;
import com.star.platforms.pojo.IceDataBean;
import com.star.platforms.redis.RedisUtils;
import com.star.platforms.vo.BannerVo;
import com.star.platforms.vo.MarketVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author sam
 */
@RestController
@RequestMapping("/stock")
public class StockTradeController {
    @Resource
    private RedisUtils redisUtil;
    /**
     * 获取大盘信息
     */
    @RequestMapping(value = "/getMarketInfoList", method = RequestMethod.GET)
    public ResultBean<List<IceDataBean.Data>> getMarketInfoList() {
        List<IceDataBean.Data> data = new ArrayList<>();
        data.clear();
        IceDataBean dataList = (IceDataBean) redisUtil.get("iceData");
        for (IceDataBean.Data item:dataList.getData()) {
            data.add( item);
        }
        return new ResultBean<>(200, "成功", data);
    }

}
